<?php
class Pageley_Controller_Session_Factory {
	private static $instance;
    private $session;

	private function __construct() { }

	public static function getInstance() {
		if(self::$instance === null) {
			self::$instance = new Pageley_Controller_Session_Factory();
		}
		return self::$instance;
	}

	public function getSession() {
        if($this->session === null) {
            if(isset($_SESSION)) {
                $this->session = new Pageley_Controller_Session_Http();
            } else {
                $this->session = new Pageley_Controller_Session_Emulator();
            }
        }
        return $this->session;
	}
}